from sqlalchemy import Column, VARCHAR, Integer, ForeignKey, Boolean
from sqlalchemy.orm import relationship

from db.base import *


class Message(BaseModel):
    __tablename__ = 'message'

    text = Column(VARCHAR(4096), nullable=False)
    chat_id = Column(Integer, ForeignKey('chat.id'))
    parent = relationship("Chat", back_populates="children")
    inbox = Column(Boolean, default=True)

